package cn.novel.bm.domain.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;


@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "用户基本信息")
public class User {

    @Id
    @Column(length = 32)
    @ApiModelProperty(value = "用户id", example = "adc8d0b4-5bee-41b9-a88a-599b6323ba8f")
    private String userId;

    @Column(length = 32, unique = true, nullable = false)
    @ApiModelProperty(value = "用户名", example = "chengfan")
    private String userName;

    @Column(length = 12, nullable = false)
    @ApiModelProperty(value = "姓名", example = "陈凡")
    private String realName;

    @Column(length = 12, nullable = false)
    @ApiModelProperty(value = "角色代码", example = "admin")
    private String roleCode;

    @Column(length = 64, nullable = false)
    @ApiModelProperty(value = "密码", example = "******")
    private String password;

    @ApiModelProperty(value = "是否锁定", example = "false")
    private Boolean isLock = false;

    private Boolean needResetPassword = false;

    private Date createAt;
    private Date updateAt;
}
